package com.example.testgame.util;

import android.content.Context;
import android.util.DisplayMetrics;

public class ScreenUtil {
	
	private static int screenWidth;
	private static int screenHeight;
	
	/**
	 * @param context
	 * @return pixels
	 * @Description: screen height
	 */
	public static int screen_height(Context context) {
		if(screenWidth == 0) {
			DisplayMetrics mDisplayMetrics = context.getApplicationContext().getResources().getDisplayMetrics();
			screenWidth =  mDisplayMetrics.heightPixels;
		}
		return screenWidth;
	}

	/**
	 * @param context
	 * @return pixels
	 * @Description: screen width
	 */
	public static int screen_width(Context context) {
		if(screenHeight == 0) {
			DisplayMetrics mDisplayMetrics = context.getApplicationContext().getResources().getDisplayMetrics();
			screenHeight = mDisplayMetrics.widthPixels;
		}
		return screenHeight;
	}

}
